package androidx.blogger;

import androidx.gdata.blogger.Blog;
import androidx.gdata.blogger.BlogCollection;
import androidx.list.AbstractListModel;

public class BlogCollectionListModel extends AbstractListModel<Blog> {
	private BlogCollection blogCollection;
	
	
	public int getCount() {
		if (blogCollection == null) {
			return 0;
		}
		return (blogCollection.getBlogs() == null) ? 0 : blogCollection.getBlogs().length;
	}

	public Blog getItem(int position) {
		if (blogCollection == null) {
			return null;
		}
		return (blogCollection.getBlogs() == null) ? null : blogCollection.getBlogs()[position];
	}
	
	public void setBlogCollection(BlogCollection blogCollection) {
		this.blogCollection = blogCollection;
		fireListModelChanged();
	}

}
